/*  This file is Copyright 2010 Hampton Smith
 *
 *  This file is part of Adventure! a text-adventure game engine by Hampton
 *  Smith.
 *
 *  Adventure! is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Adventure! is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Adventure!.  If not, see http://www.gnu.org/licenses/.
 */

package edu.clemson.cs.hamptos.adventure;

/**
 * <p>An error thrown by an <code>AdventureParser</code> to indicate that it
 * can't figure out what some named object refers to.</p>
 */
public class NoSuchTargetException extends Exception {

    private final String myItemName;

    /**
     * <p>Creates a new <code>NoSuchTargetException</code> indicating that the
     * given text could not be resolved to an actual
     * <code>AdventureTarget</code>.</p>
     * 
     * @param badItemName The text that couldn't be resolved.
     */
    public NoSuchTargetException(String badItemName) {
        myItemName = badItemName;
    }

    /**
     * <p>Returns the text that couldn't be resolved.</p>
     *
     * @return The text that couldn't be resolved.
     */
    public String getItemName() {
        return myItemName;
    }
}
